<!--  -->
<template>
  <div class="hotKeywordList">
    <header>
      <div>热门搜索</div>
      
    </header>
    <footer>
      <div class="goods" v-for="item in hotKeywordList" :key="item.keyword" @click="search(item.keyword)" :class="[item.is_hot === 1? 'active': '']">
        {{item.keyword}}
      </div>
    </footer>
  </div>
</template>

<script>
  // import {clearHistory} from '@/api/api.ts'
import {defineComponent} from 'vue'
export default defineComponent({
  name: 'HotKeywordList',
  props: {
    hotKeywordList: {
      type: Array,
      default() {
        return []
      }
    }
  },
  setup(props, {emit}) {
    const search =  (item) => {
      // console.log(emit());
      emit('getSearchReault', item)
    }
    return {
      search,
      // clear
    }
  }
})
</script>

<style lang="scss" scoped>
  .active {
    color: #ff0000;
    border: 1px solid #ff0000 !important;
  }
  .hotKeywordList {
    width: 100%;
    /* height: 200px; */
    background-color: #fff;
    padding: 20px 20px ;
    border-top: 1px solid #ccc;
    margin-top: 40px ;
  }
  header {
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 40px;
  }
  footer {
    display: flex;
    width: 100%;
    color: #969799;
    justify-content: flex-start;
    align-items: center;
    flex-flow: wrap;
    margin-top: 20px;

  }
  .goods {
    border: 1px solid #969799;
    padding: 0 4px;
    line-height: 24px;
    margin:20px 20px 0 0;
  }
</style>